#!/bin/sh
# - test

## The LTP testsuite contains a collection of tools for
## testing the Linux kernel and related features.

. $LKP_SRC/lib/env.sh
. $LKP_SRC/lib/upload.sh
. $LKP_SRC/lib/tests/ltp.sh
. $LKP_SRC/lib/reproduce-log.sh
. $LKP_SRC/lib/debug.sh

cd $BENCHMARK_ROOT/ltp || die "no $BENCHMARK_ROOT/ltp"

export PATH=/lkp/benchmarks/ltp/bin:$PATH

workaround_env

test_setting $test
create_single_test_file $test
is_excluded $test
log_cmd export LTP_RUNTIME_MUL=2

if [ -f "$BENCHMARK_ROOT/ltp/runtest/$test" ]; then
    log_cmd ./runltp -f $test $big_dev_opt $tmpdir_opt
elif [ -f "$BENCHMARK_ROOT/ltp/runtest/temp_single_test" ]; then
    log_cmd ./runltp -f temp_single_test $big_dev_opt $tmpdir_opt
else
    die "ltp test cmdfile is not found"
fi

cleanup_ltp $test

upload_files -t results $BENCHMARK_ROOT/ltp/results/* $BENCHMARK_ROOT/ltp/output
